#!/usr/bin/env node

const http = require('http');
const addr = process.argv[2];
const log = console.log
;
if(process.argv.length === 2){
    console.log('Usage:cmd url');
    process.exit();
}

http.get(addr, res => {
    log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.statusMessage}`);
    log(res.headers);
    log();
    res.pipe(process.stdout);
});